<?php

namespace adminmatrix\plugins\command\migration\migrate;

use Symfony\Component\Console\Input\InputOption;
use think\console\Input;
use think\console\input\Argument as InputArgument;
use think\console\Output;
use adminmatrix\plugins\command\migration\Command;
class Create extends Command
{
    protected function configure()
    {
        $this->setName('plugins:MigrateCreate')
            ->addOption('plugin' , '-p' , InputOption::VALUE_REQUIRED , '要执行创建数据迁移的插件目录名称')
            ->addArgument('name', InputArgument::REQUIRED, '迁移文件名称')
            ->setDescription("创建插件数据库迁移");
    }

    protected function execute(Input $input, Output $output)
    {
        $pluginName = $input->getOption('plugin');
        $creator = $this->app->get('plugin.migration.creator');
        $className = $input->getArgument('name');
        $path     = $creator->create($className , $pluginName);
//        return parent::execute($input, $output); // TODO: Change the autogenerated stub
    }
}

